package com;

import java.util.HashSet;
import java.util.Random;
import java.util.Set;


public class Test {

    static int ONEROOM = 0;
    static int M = 1;


    public synchronized static int getId() {
        int b = 0;
        if (M == (0x1fff + 1)) {
            M = 0;
        }
        Random t = new Random();
        int a = t.nextInt(64);
        int c = t.nextInt(32);
        int d = t.nextInt(16);
        int e = t.nextInt(8);
        a = a << 13;
        c = c << 13;
        d = d << 13;
        e = e << 13;
        b = a + c + d + e + M;
        if (b == ONEROOM) {
            b++;
            M++;
        }
        M++;

        return b;

    }


    public static void main(String[] args) {
        Set<Integer> set = new HashSet<>();
        for (int i = 0; i < 999999; i++) {

            int id = getId();

            set.add(id);
        }
        System.out.println(set.size());
    }
}
